#!/usr/bin/env python
# -*- coding: UTF-8 -*-

import rospy
import json
from flask import Blueprint,request, Response
import os

from parser.robot_parser import Robot_Parser
from parser.robot_parser2 import Robot_Parser2
from tool.common import *
from tool import Log_Parser
log = Log_Parser()
robot_parser = Robot_Parser()
robot_parser2 = Robot_Parser2()
robot_server = Blueprint("/robot",__name__)


#---------------------------------#
#******#   flask-网络端口验证   #******#
#---------------------------------#
@robot_server.before_request
def before():
    res_data = before_user(request)
    if res_data:
        return Response(json.dumps(res_data),  mimetype='application/json')


#---------------------------------#
    #******#   POST   #******#
#---------------------------------#
# 消杀参数设置
# req: 
# res: 
@robot_server.route('/robot_disinfect_param_set',methods=['POST'])
def Post_RobotDisinfectParamSet():
    data = request.json
    res_data = robot_parser.RobotDisinfectParamSet(data)
    return Response(json.dumps(res_data),  mimetype='application/json')

#---------------------------------#
    #******#   POST   #******#
#---------------------------------#
# 机器人深度相机参数设置
# req: 
# res: 
@robot_server.route('/robot_params_depthcamera_set',methods=['POST'])
def Post_SetRobotDepthCameraParams():
    data = request.json
    res_data = robot_parser.SetRobotDepthCameraParams(data)
    return Response(json.dumps(res_data),  mimetype='application/json')





#---------------------------------#
    #******#   POST   #******#
#---------------------------------#
# 机器人坐标获取
# req: 
# res: 
@robot_server.route('/robot_pose',methods=['POST'])
def Post_GetRobotPose():
    res_data = robot_parser.GetRobotPose_TF()
    return Response(json.dumps(res_data),  mimetype='application/json')

#---------------------------------#
    #******#   POST   #******#
#---------------------------------#
# 机器人位置安全确认
# req: {u'robot_safe': 1}
# res:
@robot_server.route('/robot_safe',methods=['POST'])
def Post_VerifyRobotSafe():
    data = request.json
    res_data = robot_parser.VerifyRobotSafe(data)
    return Response(json.dumps(res_data),  mimetype='application/json')

#---------------------------------#
    #******#   POST   #******#
#---------------------------------#
# 锁机 20230519-dw.liu
# req: 
# res:
@robot_server.route('/robot_lock',methods=['POST'])
def Post_RobotLock():
    data = request.json
    res_data = robot_parser.RobotLock(data)
    return Response(json.dumps(res_data),  mimetype='application/json')


#---------------------------------#
    #******#   POST   #******#
#---------------------------------#
# 结束手动充电状态 20230726-dw.liu
# req: 
# res:
@robot_server.route('/hand_charge_off',methods=['POST'])
def Post_HandChargeOff():
    res_data = robot_parser.HandChargeOff()
    return Response(json.dumps(res_data),  mimetype='application/json')

#---------------------------------#
    #******#   POST   #******#
#---------------------------------#
# 结束急停状态 20230726-dw.liu
# req: 
# res:
@robot_server.route('/emergency_off',methods=['POST'])
def Post_EmergencyOff():
    res_data = robot_parser.EmergencyOff()
    return Response(json.dumps(res_data),  mimetype='application/json')



#---------------------------------#
    #******#   POST   #******#
#---------------------------------#
# 设置机器人时区 20230728-dw.liu
# req: 
# res:
@robot_server.route('/robot_set_timezone',methods=['POST'])
def Post_RobotSetTimezone():
    data = request.json
    res_data = robot_parser.RobotSetTimezone(data)
    return Response(json.dumps(res_data),  mimetype='application/json')


#---------------------------------#
    #******#   POST   #******#
#---------------------------------#
# 机器人支持的新功能 20230927-dw.liu
# req: 
# res:
@robot_server.route('/robot_function',methods=['POST'])
def Post_RobotFunction():
    res_data = robot_parser.RobotFunction()
    return Response(json.dumps(res_data),  mimetype='application/json')



#---------------------------------#
    #******#   POST   #******#
#---------------------------------#
# 尘盒时间查询
# req: None
# res: 
@robot_server.route('/dustbox_cleantime_get')
def Post_GetDustboxTime():
    res_data = robot_parser.GetDustboxTime()
    return Response(json.dumps(res_data),  mimetype='application/json')

#---------------------------------#
    #******#   POST   #******#
#---------------------------------#
# 尘盒时间设置
# req: None
# res: 
@robot_server.route('/dustbox_cleantime_set',methods=['POST'])
def Post_SetDustboxTime():
    res_data = robot_parser.SetDustboxTime()
    return Response(json.dumps(res_data),  mimetype='application/json')


#---------------------------------#
    #******#   POST   #******#
#---------------------------------#
# 维护保养剩余时间查询
# req: None
# res: 
@robot_server.route('/maintenance_get',methods=['POST'])
def Post_MaintenanceGet():
    res_data = robot_parser.MaintenanceGet()
    return Response(json.dumps(res_data),  mimetype='application/json')

#---------------------------------#
    #******#   POST   #******#
#---------------------------------#
# 维护保养已保养
# req: None
# res: 
@robot_server.route('/maintenance_set',methods=['POST'])
def Post_MaintenanceSet():
    data = request.json
    res_data = robot_parser.MaintenanceSet(data)
    return Response(json.dumps(res_data),  mimetype='application/json')

# #---------------------------------#
#     #******#   POST   #******#
# #---------------------------------#
# # 开始重定位
# # req: 
# # res: 
# @robot_server.route('/relocation_start',methods=['POST'])
# def Post_StartRelocation():
#     data = request.json
#     res_data = robot_parser.StartRelocation(data)
#     return Response(json.dumps(res_data),  mimetype='application/json')

#---------------------------------#
    #******#   POST   #******#
#---------------------------------#
# 开始充电桩重定位
# req: 
# res: 
#create：2023.2.6  --dw.liu
@robot_server.route('/docker_relocation',methods=['POST'])
def Post_StartDockerRelocation():
    # data = request.json
    # res_data = robot_parser.StartDockerRelocation(data)
    res_data = robot_parser.StartDockerRelocation()
    return Response(json.dumps(res_data),  mimetype='application/json')


# #---------------------------------#
#     #******#   POST   #******#
# #---------------------------------#
# # 地图上选一个点重新定位
# # req: 
# # res: 
# #create：2023.11.20  --dw.liu
# @robot_server.route('/relocation_point',methods=['POST'])
# def Post_RelocationPoint():
#     data = request.json
#     res_data = robot_parser.RelocationPoint(data)
#     return Response(json.dumps(res_data),  mimetype='application/json')


#---------------------------------#
    #******#   POST   #******#
#---------------------------------#
# 音量查询
# req: None
# res: {'code': 0, 'data': '84', 'ret': 'ok'}
@robot_server.route('/volume_get',methods=['POST'])
def Post_GetVolume():
    res_data = robot_parser.GetVolume()
    return Response(json.dumps(res_data),  mimetype='application/json')

#---------------------------------#
    #******#   POST   #******#
#---------------------------------#
# 音量设置
# req: {u'volume': 45}
# res: {'code': 0, 'ret': 'ok'}
@robot_server.route('/volume_set',methods=['POST'])
def Post_SetVolume():
    data = request.json
    res_data = robot_parser.SetVolume(data)
    return Response(json.dumps(res_data),  mimetype='application/json')

#---------------------------------#
    #******#   GET POST   #******#
#---------------------------------#
# 获取日志等级列表
# req: None
# res: 
@robot_server.route('/log_level_get',methods=['GET','POST'])
def Post_GetLogLevelInfo():
    res_data = robot_parser.GetLogLevelInfo()
    return Response(json.dumps(res_data),  mimetype='application/json')

#---------------------------------#
    #******#   POST   #******#
#---------------------------------#
# 获取日志数据
# req: 
# res: 
@robot_server.route('/log_query',methods=['POST'])
def Post_QueryLogs():
    data = request.json
    res_data = robot_parser.QueryLogs(data)
    return Response(json.dumps(res_data),  mimetype='application/json')


#---------------------------------#
    #******#   POST   #******#
#---------------------------------#
# 日志上传到云平台
# req: 
# res: 
@robot_server.route('/log_upload',methods=['POST'])
def Post_UploadLogs():
    data = request.json
    res_data = robot_parser.UploadLogs(data)
    return Response(json.dumps(res_data),  mimetype='application/json')


#---------------------------------#
    #******#   POST   #******#
#---------------------------------#
# 查询日志上传进度
# req: 
# res: 
@robot_server.route('/log_get_progress',methods=['POST'])
def Post_GetProgressLogs():
    res_data = robot_parser.GetProgressLogs()
    return Response(json.dumps(res_data),  mimetype='application/json')

#---------------------------------#
    #******#   POST   #******#
#---------------------------------#
# 清空日志
# req: 
# res: 
@robot_server.route('/log_clean',methods=['POST'])
def Post_CleanLogs():
    res_data = robot_parser.CleanLogs()
    return Response(json.dumps(res_data),  mimetype='application/json')


#---------------------------------#
    #******#   POST   #******#
#---------------------------------#
# 激光雷达标定
# req: 
# res: 
@robot_server.route('/lidar_calib',methods=['POST'])
def Post_CalibLidar():
    data = request.json
    res_data = robot_parser.CalibLidar(data)
    return Response(json.dumps(res_data),  mimetype='application/json')


#---------------------------------#
    #******#   POST   #******#
#---------------------------------#
# 雷达安装标定 --20230406 dw.liu
# req: 
# res: 
@robot_server.route('/lidar_install_check',methods=['POST'])
def Post_LidarInstallCheck():
    res_data = robot_parser.LidarInstallCheck()
    return Response(json.dumps(res_data),  mimetype='application/json')


#---------------------------------#
    #******#   POST   #******#
#---------------------------------#
# 雷达安装标定开启 --20230413 dw.liu
# req: 
# res: 
@robot_server.route('/lidar_install_check_begin',methods=['POST'])
def Post_LidarInstallCheckBegin():
    res_data = robot_parser.LidarInstallCheckBegin()
    return Response(json.dumps(res_data),  mimetype='application/json')

#---------------------------------#
    #******#   POST   #******#
#---------------------------------#
# 雷达安装标定结束 --20230413 dw.liu
# req: 
# res: 
@robot_server.route('/lidar_install_check_stop',methods=['POST'])
def Post_LidarInstallCheckStop():
    res_data = robot_parser.LidarInstallCheckStop()
    return Response(json.dumps(res_data),  mimetype='application/json')


#---------------------------------#
    #******#   POST   #******#
#---------------------------------#
# IMU安装标定开启 --20230508 dw.liu
# req: 
# res: 
@robot_server.route('/imu_install_check_start',methods=['POST'])
def Post_ImuInstallCheckStart():
    res_data = robot_parser.ImuInstallCheckStart()
    return Response(json.dumps(res_data),  mimetype='application/json')

#---------------------------------#
    #******#   POST   #******#
#---------------------------------#
# IMU安装标定结束 --20230508 dw.liu
# req: 
# res: 
@robot_server.route('/imu_install_check_stop',methods=['POST'])
def Post_ImuInstallCheckStop():
    res_data = robot_parser.ImuInstallCheckStop()
    return Response(json.dumps(res_data),  mimetype='application/json')


#---------------------------------#
    #******#   POST   #******#
#---------------------------------#
# IMU安装标定数据 --20230508 dw.liu
# req: 
# res: 
@robot_server.route('/imu_install_check_data',methods=['POST'])
def Post_ImuInstallCheckData():
    res_data = robot_parser.ImuInstallCheckData()
    return Response(json.dumps(res_data),  mimetype='application/json')

#---------------------------------#
    #******#   POST   #******#
#---------------------------------#
# IMU SlamA安装标定开启 --20231020 dw.liu
# req: 
# res: 
@robot_server.route('/imu_install_check_start_slam_a',methods=['POST'])
def Post_ImuInstallCheckStartSlamA():
    res_data = robot_parser.ImuInstallCheckStartSlamA()
    return Response(json.dumps(res_data),  mimetype='application/json')


#---------------------------------#
    #******#   POST   #******#
#---------------------------------#
# IMU SlamA安装标定数据 查询 --20231020 dw.liu
# req: 
# res: 
@robot_server.route('/imu_install_check_data_slam_a',methods=['POST'])
def Post_ImuInstallCheckDataSlamA():
    res_data = robot_parser.ImuInstallCheckDataSlamA()
    return Response(json.dumps(res_data),  mimetype='application/json')



#---------------------------------#
    #******#   POST   #******#
#---------------------------------#
# 出厂设置
# req: 
# res: 
@robot_server.route('/factory_init_set',methods=['POST'])
def Post_SetFactoryInit():
    data = request.json
    res_data = robot_parser.SetFactoryInit(data)
    return Response(json.dumps(res_data),  mimetype='application/json')

#---------------------------------#
    #******#   POST   #******#
#---------------------------------#
# 序列号信息
# req: 
# res: 
@robot_server.route('/factory_sn_info',methods=['POST'])
def Post_GetFactorySnInfo():
    res_data = robot_parser.GetFactorySnInfo()
    return Response(json.dumps(res_data),  mimetype='application/json')

#---------------------------------#
    #******#   POST   #******#
#---------------------------------#
# 发货设置
# req: 
# res: 
@robot_server.route('/factory_deliver_set',methods=['POST'])
def Post_SetFactoryDeliver():
    res_data = robot_parser.SetFactoryDeliver()
    return Response(json.dumps(res_data),  mimetype='application/json')


#---------------------------------#
    #******#   POST   #******#
#---------------------------------#
# 修改机器型号 20230804-dw.liu
# req: 
# res: 
@robot_server.route('/factory_update_type',methods=['POST'])
def Post_FactoryUpdateType():
    data = request.json
    res_data = robot_parser.FactoryUpdateType(data)
    return Response(json.dumps(res_data),  mimetype='application/json')


#---------------------------------#
    #******#   POST   #******#
#---------------------------------#
# 机器人型号列表 20240508-dw.liu
# req: 
# res: 
@robot_server.route('/robot_type_list',methods=['POST'])
def Post_RobotTypeList():
    res_data = robot_parser.RobotTypeList()
    return Response(json.dumps(res_data),  mimetype='application/json')


#---------------------------------#
    #******#   POST   #******#
#---------------------------------#
# rviz发布坐标点
# req: 
# res:
# 2023.2.1 --dw.liu 
@robot_server.route('/rviz_points',methods=['POST'])
def Post_RvizPoints():
    data = request.json
    res_data = robot_parser.RvizPoints(data)
    return Response(json.dumps(res_data),  mimetype='application/json')


@robot_server.route('/reset_ubuntu_pd',methods=['POST'])
def reset_ubuntu_pd():
    res_data=robot_parser2.reset_ubuntu_pd()
    return Response(json.dumps(res_data),  mimetype='application/json')


#---------------------------------#
    #******#   POST   #******#
#---------------------------------#
# 当前的报警记录
# req: 
# res:
# 20230515-dw.liu
@robot_server.route('/current_warn_list',methods=['POST'])
def Post_CurrentWarnList():
    res_data = robot_parser.CurrentWarnList()
    return Response(json.dumps(res_data),  mimetype='application/json')


#---------------------------------#
    #******#   POST   #******#
#---------------------------------#
# 开始录制bag
# req: 
# res:
# 20230912-dw.liu
@robot_server.route('/bag_record_start',methods=['POST'])
def Post_BagRecordStart():
    data = request.json
    res_data = robot_parser.BagRecordStart(data)
    return Response(json.dumps(res_data),  mimetype='application/json')


#---------------------------------#
    #******#   POST   #******#
#---------------------------------#
# 结束录制bag
# req: 
# res:
# 20230912-dw.liu
@robot_server.route('/bag_record_end',methods=['POST'])
def Post_BagRecordEnd():
    res_data = robot_parser.BagRecordEnd()
    return Response(json.dumps(res_data),  mimetype='application/json')


#---------------------------------#
    #******#   POST   #******#
#---------------------------------#
# 获取当前bag状态
# req: 
# res:
# 20230912-dw.liu
@robot_server.route('/bag_record_status',methods=['POST'])
def Post_BagRecordStatus():
    res_data = robot_parser.BagRecordStatus()
    return Response(json.dumps(res_data),  mimetype='application/json')


#---------------------------------#
    #******#   POST   #******#
#---------------------------------#
# 读取user_config下的文件，主要用于图片的显示
# req: 
# res:
# 20230912-dw.liu
@robot_server.route('/robot_files/<path:path>',methods=['GET'])
def Get_robot_user_config_files(path):
    print ("path ->"+path)
    try:
        absolute_path_="/home/aoting/user_config/{}".format(path)
        if not os.path.exists(absolute_path_):
            return Response(json.dumps({"code":1,"msg":"file not fount"}),  mimetype='application/json')
        mime_type = guess_mimetype(absolute_path_)
        return Response(file(absolute_path_), mimetype=mime_type)
    except Exception as err:
        print(err)
        return Response(json.dumps({"code":2,"msg":str(err)}),  mimetype='application/json')



#---------------------------------#
# ft.wang 20240606接手
#---------------------------------#
# 外设控制设置默认参数列表 获取
@robot_server.route('/utils_ctrl_default_list',methods=['POST'])
def Post_GetCleandeviceWithMemoryParams():
    res_data = robot_parser.GetCleandeviceWithMemoryParams()
    return Response(json.dumps(res_data),  mimetype='application/json')


# 外设控制设置默认参数 设置
@robot_server.route('/utils_ctrl_default_set',methods=['POST'])
def Post_SetCleandeviceWithMemoryParams():
    data = request.json
    log.LogInfo(rospy.get_name(), "request_info: {}, data: {}".format(getRequestInfo(request), data))
    res_data = robot_parser.SetCleandeviceWithMemoryParams(data)
    return Response(json.dumps(res_data),  mimetype='application/json')


# 外设控制设置默认参数 删除
@robot_server.route('/utils_ctrl_default_del',methods=['POST'])
def Post_DeleteCleandeviceWithMemoryParams():
    data = request.json
    log.LogInfo(rospy.get_name(), "request_info: {}, data: {}".format(getRequestInfo(request), data))
    res_data = robot_parser.DeleteCleandeviceWithMemoryParams(data)
    return Response(json.dumps(res_data),  mimetype='application/json')


# 外设控制设置默认参数 添加
@robot_server.route('/utils_ctrl_default_add',methods=['POST'])
def Post_AddCleandeviceWithMemoryParams():
    data = request.json
    log.LogInfo(rospy.get_name(), "request_info: {}, data: {}".format(getRequestInfo(request), data))
    res_data = robot_parser.AddCleandeviceWithMemoryParams(data)
    return Response(json.dumps(res_data),  mimetype='application/json')


# 外设控制设置默认参数 修改
@robot_server.route('/utils_ctrl_default_edit',methods=['POST'])
def Post_ChangeCleandeviceWithMemoryParams():
    data = request.json
    log.LogInfo(rospy.get_name(), "request_info: {}, data: {}".format(getRequestInfo(request), data))
    res_data = robot_parser.ChangeCleandeviceWithMemoryParams(data)
    return Response(json.dumps(res_data),  mimetype='application/json')


# 外设控制参数（出厂参数）重置接口
@robot_server.route('/utils_reset',methods=['POST'])
def Post_CleandeviceParamsReset():
    data = request.json
    log.LogInfo(rospy.get_name(), "request_info: {}, data: {}".format(getRequestInfo(request), data))
    res_data = robot_parser.CleandeviceParamsReset(data)
    return Response(json.dumps(res_data),  mimetype='application/json')


# 机器人参数设置
@robot_server.route('/robot_params_set',methods=['POST'])
def Post_SetRobotParams():
    data = request.json
    log.LogInfo(rospy.get_name(), "request_info: {}, data: {}".format(getRequestInfo(request), data))
    res_data = robot_parser.SetRobotParams(data)
    return Response(json.dumps(res_data),  mimetype='application/json')


# 机器人参数获取
@robot_server.route('/robot_params_get',methods=['POST'])
def Post_GetRobotParams():
    res_data = robot_parser.GetRobotParams()
    return Response(json.dumps(res_data),  mimetype='application/json')    

# 深度相机标定
@robot_server.route('/depth_camera_calibration',methods=['POST'])
def Post_DepthCameraCalibration():
    data = request.json
    res_data = robot_parser.DepthCameraCalibration(data)
    return Response(json.dumps(res_data),  mimetype='application/json')    

# bag数据录制
@robot_server.route('/bag_record_trigger',methods=['POST'])
def Post_BagRecordTrigger():
    data = request.json
    res_data = robot_parser.BagRecordTrigger(data)
    return Response(json.dumps(res_data),  mimetype='application/json')

# 云同步 - 地图数据备份
@robot_server.route('/map_backup_sync',methods=['POST'])
def Post_MapBackupSync():
    data = request.json
    res_data = robot_parser.MapBackupSync(data)
    return Response(json.dumps(res_data),  mimetype='application/json')

# 云同步 - 文件上传
@robot_server.route('/cloudsync_file',methods=['POST'])
def Post_FileCloudSync():
    data = request.json
    res_data = robot_parser.FileCloudSync(data)
    return Response(json.dumps(res_data),  mimetype='application/json')




# # 获取版本信息  flag=0 获取版本信息 1获取版本安装进度
# @robot_server.route('/check_update',methods=['GET','POST'])
# def Post_GetVersionInfo():
#     res_data = robot_parser.GetVersionInfo()
#     return Response(json.dumps(res_data),  mimetype='application/json')

# @robot_server.route('/software_update_progress',methods=['GET','POST'])
# def Post_GetSoftwareUpdateProgress():
#     res_data = robot_parser.GetSoftwareUpdateProgress()
#     return Response(json.dumps(res_data),  mimetype='application/json')

# # 软件确认升级 下载安装包
# @robot_server.route('/software_update',methods=['POST'])
# @robot_server.route('/is_update',methods=['POST'])
# def Post_UpdateVersion():
#     data = request.json
#     res_data = robot_parser.UpdateVersion(data)
#     return Response(json.dumps(res_data),  mimetype='application/json')

# # 查询软件历史版本
# @robot_server.route('/software_version_list',methods=['POST'])
# def Post_SoftwareVersionList():
#     res_data = robot_parser.SoftwareVersionList()
#     return Response(json.dumps(res_data),  mimetype='application/json')


# # 下载硬件固件
# @robot_server.route('/hardware_update',methods=['POST'])
# def Post_DowanloadFirmwareVersion():
#     res_data = robot_parser.DowanloadFirmwareVersion()
#     #print("------2222----")
#     return Response(json.dumps(res_data),  mimetype='application/json')

# # 硬件固件升级安装
# @robot_server.route('/hardware_install',methods=['POST'])
# def Post_UpdateFirmwareVersion():
#     res_data = robot_parser.UpdateFirmwareVersion()
#     #print("------2222----")
#     return Response(json.dumps(res_data),  mimetype='application/json')

# # 机器是否重启
# @robot_server.route('/robot_reboot',methods=['POST'])
# def Post_RobotReboot():
#     data = request.json
#     log.LogInfo(rospy.get_name(), "request_info: {}, data: {}".format(getRequestInfo(request), "请求重启操作。"))
#     res_data = robot_parser.RobotReboot(data)
#     return Response(json.dumps(res_data),  mimetype='application/json')












# #---------------------------------#
#     #******#   POST   #******#
# #---------------------------------#
# # 深度相机安装标定开始 --20230418 dw.liu
# # req: 
# # res: 
# @robot_server.route('/depth_install_check_start',methods=['POST'])
# def Post_DepthInstallCheckStart():
#     data = request.json
#     res_data = robot_parser.DepthInstallCheckStart(data)
#     return Response(json.dumps(res_data),  mimetype='application/json')

# #---------------------------------#
#     #******#   POST   #******#
# #---------------------------------#
# # 深度相机安装标定结束 --20230418 dw.liu
# # req: 
# # res: 
# @robot_server.route('/depth_install_check_stop',methods=['POST'])
# def Post_DepthInstallCheckStop():
#     data = request.json
#     res_data = robot_parser.DepthInstallCheckStop(data)
#     return Response(json.dumps(res_data),  mimetype='application/json')


# #---------------------------------#
#     #******#   POST   #******#
# #---------------------------------#
# # 深度相机安装标定数据 --20230418 dw.liu
# # req: 
# # res: 
# @robot_server.route('/depth_install_checkdata',methods=['POST'])
# def Post_DepthInstallCheckDate():
#     res_data = robot_parser.DepthInstallCheckDate()
#     return Response(json.dumps(res_data),  mimetype='application/json')


# #---------------------------------#
#     #******#   POST   #******#
# #---------------------------------#
# # 深度相机现场标定数据 --20240313 dw.liu
# # req: 
# # res: 
# @robot_server.route('/depth_install',methods=['POST'])
# def Post_DepthInstall():
#     data = request.json
#     res_data = robot_parser.DepthInstall(data)
#     return Response(json.dumps(res_data),  mimetype='application/json')


# #---------------------------------#
#     #******#   POST   #******#
# #---------------------------------#
# # 一键联合校准下的开始位置校准--20240513 dw.liu
# # req: 
# # res: 
# @robot_server.route('/position_calibration',methods=['POST'])
# def Post_PositionCalibration():
#     res_data = robot_parser.PositionCalibration()
#     return Response(json.dumps(res_data),  mimetype='application/json')

# #---------------------------------#
#     #******#   POST   #******#
# #---------------------------------#
# # 一键联合校准下的,开始位置校准后，获取相关信息--20240513 dw.liu
# # req: 
# # res: 
# @robot_server.route('/position_calibration_check_data',methods=['POST'])
# def Post_PositionCalibrationCheckData():
#     res_data = robot_parser.PositionCalibrationCheckData()
#     return Response(json.dumps(res_data),  mimetype='application/json')

# #---------------------------------#
#     #******#   POST   #******#
# #---------------------------------#
# # 一键联合校准下的开始相机校准--20240513 dw.liu
# # req: 
# # res: 
# @robot_server.route('/co_calibration',methods=['POST'])
# def Post_CoCalibration():
#     res_data = robot_parser.CoCalibration()
#     return Response(json.dumps(res_data),  mimetype='application/json')




